package com.gzbit.calculater.simplefactory;

import com.gzbit.calculater.bll.AddOperation;
import com.gzbit.calculater.bll.*;
import com.gzbit.calculater.ui.Test;

public class simpleFactory {
    public IOperation getOperation(String oprType) throws Exception {
        IOperation opr=null;
        switch (oprType){
            case"+":
                opr=new AddOperation();
                break;
            case"-":
                opr=new SubOperation();
                break;
            default:
                throw new Exception("输入的运算符号错误");
        }
        return opr;
    }

}
